﻿
namespace ICommonLibrary.Json {

    public class JsonBoolean : JsonValue {

        public bool Value { get; set; }

        public JsonBoolean(bool value) {
            Value = value;
        }

        public override JsonBoolean IsBoolean() {
            return this;
        }

        public override bool Equals(object obj) {
            var s = obj as JsonBoolean;
            if (s == null) {
                return false;
            }
            return Value == s.Value;
        }

        public override int GetHashCode() {
            return Value ? 1 : 0;
        }

        public override string ToJsonString() {
            return Value ? "true" : "false";
        }

    }
}